<?php
/**
 * Created by PhpStorm.
 * User: wliu
 * Date: 14-3-30
 * Time: 下午9:12
 */

class Cowry extends EMongoDocument {
    public $gid;

    public $name_zn;

    public $name_en;

    public $images;

    public $thumbnails;

    public $desc_zn;

    public $desc_en;

    public $uploadtime;

    public $userid;

    public $orderid;

    public $buytime;

    public $sales;

    public $comment;


    /**
     * This method have to be defined in every Model
     * @return string MongoDB collection name, witch will be used to store documents of this model
     */
    public function getCollectionName()
    {
        return 'cowry';
    }

    // We can define rules for fields, just like in normal CModel/CActiveRecord classes
    public function rules()
    {
        return array(

        );
    }

    // the same with attribute names
    public function attributeNames() {
        return array(
            'name_zn' => 'name_zn',
            'name_en' => 'name_en',
            'desc_zn'=>'desc_zn',
            'desc_en'=>'desc_en',
            'uploadtime'=>'uploadtime',
            'userid'=>'userid',
            'orderid'=>'orderid',
            'images'=>'images',
            'gid'=>'gid',
            'buytime'=>'buytime',
            'sales'=>'sales',
            'comment'=>'comment',
            'thumbnails'=>'thumbnails',
            '_id'=>"_id",
        );
    }

    /**
     * This method have to be defined in every model, like with normal CActiveRecord
     */
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

} 